﻿using System;
using System.Diagnostics;
using EzDesk.DesktopClient.Event;
using EzDesk.EventAggregation;

namespace EzDesk.DesktopClient
{
    public class ManagementBaseWithUserLogStatus<TManagmentType> : ManagementBase<TManagmentType> where TManagmentType : new()
    {
        public ManagementBaseWithUserLogStatus()
            : base()
        {
            InitEvent();
        }

        protected void InitEvent()
        {
            LoginEvent.Instance.Subscribe(this.OnUserLogin, ThreadOption.PublisherThread);
            LoginedEvent.Instance.Subscribe(this.AfterUserLogin, ThreadOption.PublisherThread);
            LogoutEvent.Instance.Subscribe(this.OnUserLogout, ThreadOption.PublisherThread);
        }

        protected virtual void AfterUserLogin(LoginArgs obj)
        {
            Debug.Write("superwolf");
        }

        protected virtual void OnUserLogout(LogoutArgs args)
        {
            Debug.Write("superwolf");
        }

        protected virtual void OnUserLogin(LoginArgs args)
        {
            Debug.Write("comeon");
        }
    }
}